<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp" %>
<div id="SaveOrUpdateDriverWin"
	style="width: 600px; height: 410px; padding: 10px;overflow-y: auto;"
	class="easyui-dialog" title="申请操作"
	data-options="modal:true,closed:true,minimizable:false,collapsible:false,maximizable:false,iconCls:'icon-save',onClose:function(){$('#saveOrUpdateDevForm')[0].reset();} ">
	<form id="applySfzForm" method="post" enctype="multipart/form-data" >
	       <!--身份证号  -->
		<div class="menu_form_body">
		  <table  border="0" cellpadding="0" cellspacing="0" width="100%">
				<tr>
					<td align="right" width="100" height="40"
						class="tangchukuangliebiao1">
						<input id="sfSelect" style="width: 95%;" type="text" class="shurukuangkais" placeholder="请输入驾驶证号码" value="" />
					</td>
					<td align="left" width="150" class="tangchukuangliebiao1">
						<a href="###" class="congzhim" id="chaxun" style="margin: 0 5px 2px 0;">查询</a>
					</td>
				</tr>
			</table>
			<table name="hphm" border="0" cellpadding="0" cellspacing="0" width="100%" class="cheliangxinxi">
			   <tr>
	         	 <th align="right" height="26" width="100">姓名：</th>
	             <td>
	                 <span class="indexstylelist" id="xm"></span>
	             </td>
	             <th align="right" height="26" width="100">性别：</th>
	             <td>
	             		<span class="indexstylelist" id="xb"></span>
	             </td>
	         </tr>
	     	 <tr>
	         	 <th align="right" height="26">驾驶证号码：</th>
	             <td>
	                 <span class="indexstylelist" id="sfzmhm1"></span>
	             </td>
	             <th align="right" height="26">发证机关：</th>
                 <td>
                     <span class="indexstylelist" id="fzjg"></span>
                 </td>
	         </tr>
	           <tr>
                   <th align="right">备注：</th>
                   <td colspan="3">
                      <input id="bz1" class="easyui-textbox" data-options="multiline:true"  style="width:300px;height:100px"/>
                    </td>
               </tr>
			</table>
			<div class="shenqinganniudss" id="dd1" style="display:none;">
				<a href="###" class="sousuocx" id="applyPrintDriver" applyType="01" style="padding: 1px 10px; margin: 0 4px 0 0;">申请打印</a>
				<a href="###" class="sousuocx" id="applyDownloadDriver" applyType="02" style="padding: 1px 10px; margin: 0 4px 0 0;">申请下载</a>
				<a href="###" class="sousuocx2" id="applyDeleteDriver" applyType="03" style="padding: 1px 10px; margin: 0 4px 0 0;">申请删除</a>
			</div>
		</div>
	</form>
</div>

<script type="text/javascript">
   $(function(){
	   $('#applyPrintDriver,#applyDownloadDriver,#applyDeleteDriver').unbind('click').bind('click',function(data){
		   debugger;
		   var bz=$.trim($('#bz').val());
		   if(bz.length>400){
			   bz=bz.substring(0,400);
		   }
		   var $this=$(this);
		   var applyType=$this.attr('applyType');
           var sfzmhm=$('#sfzmhm1').text();//驾驶证号码(身份证号码)
           var hphm=$('#hphmmc').text();
           var message=$this.text();
           if(confirm('确认'+message+'？')){
        	   $.ajax({
                   type:'post',
                   url:'${ctx}/audit/addAudit.htm',
                   data:{
                      hphm:hphm,
                      sfzmhm:sfzmhm,
                      permissionType:applyType,
                      bz:bz,
                       bussinessType:'2'
                   },
                   success:function(data){
                       debugger;
                      if(data=='00'){
                          alert('申请失败，请稍后再试');
                      }else if(data=='01'){
                          alert('申请成功');
                      }else if(data=='02'){
                          alert('该权限已申请成功，不用再次申请');
                      }
                   }
                });
           }
	   });
	   
	   //查询
	   $('#chaxun').unbind('click').bind('click',function(){
		   debugger;
		   clearDriverInfo();
		   var sfzmhm=$.trim($('#sfSelect').val());//驾驶证号码(身份证号码)
		   if(sfzmhm!='' ){
		       $.ajax({
		           type:'post',
		           url:'${ctx}/yxxx/queryBySfz.htm',
		           data:{
		        	   sfzmhm:sfzmhm
		           },
		           dataType:'json',
		           success:function(data){
		               debugger;
		               if(null!=data && data.sfzmhm!=''){
		            	   $('#dd1').show();
		            	   $('#xm').text(data.xm);
		            	   $('#xb').text(data.xb);
		            	   $('#sfzmhm1').text(data.sfzmhm);
		            	   $('#fzjg').text(data.fzjg);
		               }else{
		            	   $('#dd1').hide();
		            	   alert('该驾驶证号码不存在，请重新输入');
		               }
		           }
		       });
		   }else{
			   alert('请输入驾驶证号码!');
		   }
		});
   });
</script>